/*
    9. Write a program in C to display the pattern like right angle triangle using an asterisk. 

    The pattern like :

    *
    **
    ***
    ****
*/

#include <stdio.h>

int main(void){
    int i,j;
    int lines = 4;
    for(i = 0; i < lines; i++){
        for(j = 0; j <= i; j++){
            printf("*");
        }
        printf("\n");
    }
    printf("\n");
    for(i = 0; i < lines; i++){
        for(j = 0; j <= i; j++){
            printf("%d", j + 1);
        }
        printf("\n");
    }
    printf("\n");
    for(i = 0; i < lines; i++){
        for(j = 0; j <= i; j++){
            printf("%d", i + 1);
        }
        printf("\n");
    }
    printf("\n");
    int num = 1;
    for(i = 0; i < lines; i++){
        for(j = 0; j <= i; j++){
            printf("%d ", num);
            num++;
        }
        printf("\n");
    }

    printf("\n");
    num = 1;
    for(i = 0; i < lines; i++){
        for(j = 0; j < lines - i - 1; j++){
            printf(" ");
        }
        for(j = 0; j <= i; j++){
            printf("%d ", num);
            num++;
        }
        printf("\n");
    }

    printf("\n");
    for(i = 0; i < lines; i++){
        for(j = 0; j < lines - i - 1; j++){
            printf(" ");
        }
        for(j = 0; j <= i; j++){
            printf("* ");
        }
        printf("\n");
    }

    printf("\n");
    for(i = 0; i < lines; i++){
        for(j = 0; j < lines - i - 1; j++){
            printf(" ");
        }
        for(j = 0; j <= i; j++){
            printf("* ");
        }        
        printf("\n");
    }
    for(i = lines - 1; i > 0; i--){
        for(j = lines - i; j > 0; j--){
            printf(" ");
        }
        for(j = i; j > 0; j--){
            printf("* ");
        }
        printf("\n");
    }
    return 0;
}